import { regPhone } from "@/utils/validate";

export const totalPriceLevels = [
  {
    value: "0",
    label: "等级一"
  },
  {
    value: "1",
    label: "等级二"
  }
];
export const fromTypes = [
  {
    value: "0",
    label: "抖音"
  },
  {
    value: "1",
    label: "淘宝"
  }
];
export const houseTypes = [
  {
    label: "毛坯",
    value: "1"
  },
  {
    label: "精装新房",
    value: "2"
  },
  {
    label: "旧房改造",
    value: "4"
  }
];
export const businessTypes = [
  {
    label: "全案",
    value: "1"
  },
  {
    label: "整装",
    value: "2"
  },
  {
    label: "基装",
    value: "3"
  },
  {
    label: "软装",
    value: "4"
  },
  {
    label: "家居单品",
    value: "5"
  },
  {
    label: "旧改",
    value: "6"
  }
];
export const fitments = [
  {
    label: "自住",
    value: "1"
  },
  {
    label: "出租",
    value: "2"
  }
];
export const customerBudgets = [
  {
    label: "100万以下",
    value: "1"
  },
  {
    label: "100-200万",
    value: "2"
  }
];
export const customerProfile = [
  {
    label: "普通客户",
    value: "1"
  },
  {
    label: "VIP客户",
    value: "2"
  }
];
export const depts = [
  {
    label: "销售部",
    value: "1"
  },
  {
    label: "设计部",
    value: "2"
  },
  {
    label: "工程部",
    value: "3"
  },
  {
    label: "财务部",
    value: "4"
  },
  {
    label: "客服部",
    value: "5"
  }
];

export const formDataInit = {
  customerName: "3223",
  mobileCode: "15902330908",
  fitmentAreaIds: [],
  residence: "",
  buildingName: "",
  address: "",
  area: 0,
  totalPriceLevel: "",
  totalPriceLevelName: "",
  fromType: "",
  fromTypeName: "",
  houseType: "",
  houseTypeName: "",
  fitment: ["自住"],
  fitmentName: "自住",
  businessType: "",
  businessTypeName: "",
  budget: "",
  budgetName: "",
  isFutures: "0",
  isFuturesName: "否",
  remark: "",
  deptId: "",
  businessUserId: "",
  businessUserName: "",
  portaintId: "",
  portaintName: "",
  fromDetailType: "",
  fromDetailTypeName: ""
};
const phoneValidator = (rule, value, callback) => {
  if (!regPhone(value)) {
    callback(new Error("手机号格式不正确"));
  } else {
    callback();
  }
};
export const myClientRules = {
  customerName: { required: true, message: "客户姓名不能为空", trigger: "blur" },
  mobileCode: [
    { required: true, message: "客户电话不能为空", trigger: "blur" },
    { validator: phoneValidator, message: "手机号格式不正确", trigger: "blur" }
  ],
  businessUserId: { required: true, message: "请选择业务人员", trigger: "change" },
  deptId: { required: true, message: "请选择业务人员部门", trigger: "change" },
  portaintId: { required: true, message: "请选择业务画像", trigger: "change" }
};

export const loseCauses = [
  {
    label: "已签约其它公司",
    value: "1"
  },
  {
    label: "不考虑",
    value: "2"
  },
  {
    label: "产品价格过高",
    value: "3"
  },
  {
    label: "超出预算",
    value: "4"
  },
  {
    label: "方案不满意",
    value: "5"
  },
  {
    label: "其它",
    value: "6"
  }
];

export const fllowUpTypes = [
  {
    label: "电话",
    value: "1"
  },
  {
    label: "微信",
    value: "2"
  },
  {
    label: "QQ",
    value: "3"
  },
  {
    label: "上门",
    value: "4"
  },
  {
    label: "其他",
    value: "5"
  }
];

/**
 * 分页
 * */
export const pageSizes = [
  {
    label: "20条/每页",
    value: 20
  },
  {
    label: "50条/每页",
    value: 50
  },
  {
    label: "100条/每页",
    value: 100
  },
  {
    label: "200条/每页",
    value: 200
  },
  {
    label: "500条/每页",
    value: 500
  }
];
